package com.yicong.ants.bean.global;

import com.yicong.ants.Constants;

import org.jetbrains.annotations.NotNull;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ClientConfig {
    String trans_rule_image;
    String task_rule_image;
    String hotel_rule_image;
    String rp_verify_rule;
    String tip_public_video_comment;
    String task_fetch_tip;
    String ticket_rule_image;

    int rp_type; // 0=活体，1=身份证

    NoticeItem activity; // 活动
    NoticeItem marquee;  // 滚动公告
    NoticeItem notice;   // 弹出公告
    public Map<String, WebUrl> web_url = new HashMap<>();
    String ad_task_switch;
    String happy_new_year_switch;
    //是否展示门票兑换yc
    public boolean yc_task_coin_exchange_switch;
    //yc仓库
    public List<Type_info> yc_type;
    public List<Type_info> yc_stock_type;

    public ClientConfig() {
    }

    public boolean isNewYear() {
        return "1".equals(happy_new_year_switch);
    }

    @NotNull
    public WebUrl getWebUrl(@NotNull String key) {
        if (web_url.containsKey(key)) {
            return web_url.get(key);
        }
        return new WebUrl();
    }

    public String getTrans_rule_image() {
        return this.trans_rule_image;
    }

    public String getTask_rule_image() {
        return this.task_rule_image;
    }

    public String getHotel_rule_image() {
        return this.hotel_rule_image;
    }

    public String getRp_verify_rule() {
        return this.rp_verify_rule;
    }

    public String getTip_public_video_comment() {
        return this.tip_public_video_comment;
    }

    public String getTask_fetch_tip() {
        return this.task_fetch_tip;
    }

    public int getRp_type() {
        return this.rp_type;
    }

    public NoticeItem getActivity() {
        return this.activity;
    }

    public NoticeItem getMarquee() {
        return this.marquee;
    }

    public NoticeItem getNotice() {
        return this.notice;
    }

    public Map<String, WebUrl> getWeb_url() {
        return this.web_url;
    }

    public String getAd_task_switch() {
        return this.ad_task_switch;
    }

    public String getHappy_new_year_switch() {
        return this.happy_new_year_switch;
    }

    public void setTrans_rule_image(String trans_rule_image) {
        this.trans_rule_image = trans_rule_image;
    }

    public void setTask_rule_image(String task_rule_image) {
        this.task_rule_image = task_rule_image;
    }

    public void setHotel_rule_image(String hotel_rule_image) {
        this.hotel_rule_image = hotel_rule_image;
    }

    public void setRp_verify_rule(String rp_verify_rule) {
        this.rp_verify_rule = rp_verify_rule;
    }

    public void setTip_public_video_comment(String tip_public_video_comment) {
        this.tip_public_video_comment = tip_public_video_comment;
    }

    public void setTask_fetch_tip(String task_fetch_tip) {
        this.task_fetch_tip = task_fetch_tip;
    }

    public void setRp_type(int rp_type) {
        this.rp_type = rp_type;
    }

    public void setActivity(NoticeItem activity) {
        this.activity = activity;
    }

    public void setMarquee(NoticeItem marquee) {
        this.marquee = marquee;
    }

    public void setNotice(NoticeItem notice) {
        this.notice = notice;
    }

    public void setWeb_url(Map<String, WebUrl> web_url) {
        this.web_url = web_url;
    }

    public void setAd_task_switch(String ad_task_switch) {
        this.ad_task_switch = ad_task_switch;
    }

    public void setHappy_new_year_switch(String happy_new_year_switch) {
        this.happy_new_year_switch = happy_new_year_switch;
    }

    public String getTicket_rule_image() {
        return ticket_rule_image;
    }

    public void setTicket_rule_image(String ticket_rule_image) {
        this.ticket_rule_image = ticket_rule_image;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof ClientConfig)) return false;
        final ClientConfig other = (ClientConfig) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$trans_rule_image = this.getTrans_rule_image();
        final Object other$trans_rule_image = other.getTrans_rule_image();
        if (this$trans_rule_image == null ? other$trans_rule_image != null : !this$trans_rule_image.equals(other$trans_rule_image))
            return false;
        final Object this$task_rule_image = this.getTask_rule_image();
        final Object other$task_rule_image = other.getTask_rule_image();
        if (this$task_rule_image == null ? other$task_rule_image != null : !this$task_rule_image.equals(other$task_rule_image))
            return false;
        final Object this$hotel_rule_image = this.getHotel_rule_image();
        final Object other$hotel_rule_image = other.getHotel_rule_image();
        if (this$hotel_rule_image == null ? other$hotel_rule_image != null : !this$hotel_rule_image.equals(other$hotel_rule_image))
            return false;
        final Object this$rp_verify_rule = this.getRp_verify_rule();
        final Object other$rp_verify_rule = other.getRp_verify_rule();
        if (this$rp_verify_rule == null ? other$rp_verify_rule != null : !this$rp_verify_rule.equals(other$rp_verify_rule))
            return false;
        final Object this$tip_public_video_comment = this.getTip_public_video_comment();
        final Object other$tip_public_video_comment = other.getTip_public_video_comment();
        if (this$tip_public_video_comment == null ? other$tip_public_video_comment != null : !this$tip_public_video_comment.equals(other$tip_public_video_comment))
            return false;
        final Object this$task_fetch_tip = this.getTask_fetch_tip();
        final Object other$task_fetch_tip = other.getTask_fetch_tip();
        if (this$task_fetch_tip == null ? other$task_fetch_tip != null : !this$task_fetch_tip.equals(other$task_fetch_tip))
            return false;
        if (this.getRp_type() != other.getRp_type()) return false;
        final Object this$activity = this.getActivity();
        final Object other$activity = other.getActivity();
        if (this$activity == null ? other$activity != null : !this$activity.equals(other$activity))
            return false;
        final Object this$marquee = this.getMarquee();
        final Object other$marquee = other.getMarquee();
        if (this$marquee == null ? other$marquee != null : !this$marquee.equals(other$marquee))
            return false;
        final Object this$notice = this.getNotice();
        final Object other$notice = other.getNotice();
        if (this$notice == null ? other$notice != null : !this$notice.equals(other$notice))
            return false;
        final Object this$web_url = this.getWeb_url();
        final Object other$web_url = other.getWeb_url();
        if (this$web_url == null ? other$web_url != null : !this$web_url.equals(other$web_url))
            return false;
        final Object this$ad_task_switch = this.getAd_task_switch();
        final Object other$ad_task_switch = other.getAd_task_switch();
        if (this$ad_task_switch == null ? other$ad_task_switch != null : !this$ad_task_switch.equals(other$ad_task_switch))
            return false;
        final Object this$happy_new_year_switch = this.getHappy_new_year_switch();
        final Object other$happy_new_year_switch = other.getHappy_new_year_switch();
        if (this$happy_new_year_switch == null ? other$happy_new_year_switch != null : !this$happy_new_year_switch.equals(other$happy_new_year_switch))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof ClientConfig;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $trans_rule_image = this.getTrans_rule_image();
        result = result * PRIME + ($trans_rule_image == null ? 43 : $trans_rule_image.hashCode());
        final Object $task_rule_image = this.getTask_rule_image();
        result = result * PRIME + ($task_rule_image == null ? 43 : $task_rule_image.hashCode());
        final Object $hotel_rule_image = this.getHotel_rule_image();
        result = result * PRIME + ($hotel_rule_image == null ? 43 : $hotel_rule_image.hashCode());
        final Object $rp_verify_rule = this.getRp_verify_rule();
        result = result * PRIME + ($rp_verify_rule == null ? 43 : $rp_verify_rule.hashCode());
        final Object $tip_public_video_comment = this.getTip_public_video_comment();
        result = result * PRIME + ($tip_public_video_comment == null ? 43 : $tip_public_video_comment.hashCode());
        final Object $task_fetch_tip = this.getTask_fetch_tip();
        result = result * PRIME + ($task_fetch_tip == null ? 43 : $task_fetch_tip.hashCode());
        result = result * PRIME + this.getRp_type();
        final Object $activity = this.getActivity();
        result = result * PRIME + ($activity == null ? 43 : $activity.hashCode());
        final Object $marquee = this.getMarquee();
        result = result * PRIME + ($marquee == null ? 43 : $marquee.hashCode());
        final Object $notice = this.getNotice();
        result = result * PRIME + ($notice == null ? 43 : $notice.hashCode());
        final Object $web_url = this.getWeb_url();
        result = result * PRIME + ($web_url == null ? 43 : $web_url.hashCode());
        final Object $ad_task_switch = this.getAd_task_switch();
        result = result * PRIME + ($ad_task_switch == null ? 43 : $ad_task_switch.hashCode());
        final Object $happy_new_year_switch = this.getHappy_new_year_switch();
        result = result * PRIME + ($happy_new_year_switch == null ? 43 : $happy_new_year_switch.hashCode());
        return result;
    }

    public String toString() {
        return "ClientConfig(trans_rule_image=" + this.getTrans_rule_image() + ", task_rule_image=" + this.getTask_rule_image() + ", hotel_rule_image=" + this.getHotel_rule_image() + ", rp_verify_rule=" + this.getRp_verify_rule() + ", tip_public_video_comment=" + this.getTip_public_video_comment() + ", task_fetch_tip=" + this.getTask_fetch_tip() + ", rp_type=" + this.getRp_type() + ", activity=" + this.getActivity() + ", marquee=" + this.getMarquee() + ", notice=" + this.getNotice() + ", web_url=" + this.getWeb_url() + ", ad_task_switch=" + this.getAd_task_switch() + ", happy_new_year_switch=" + this.getHappy_new_year_switch() + ")";
    }

    public static class NoticeItem {

        /**
         * id : 17
         * operation : 0
         * title :
         * img :
         * link :
         * content : APP公告：蚁丛号注销通知！<br/>
         * 致所有蚁丛会员，自2021年1月1日起连续30天未完成过任务的蚁丛号将被系统自动注销。<br/>
         * 如需恢复已注销账号请于2021年1月15日前联系推荐人或团队长恢复，自恢复日期起3天内仍未领取旅游任务包的账号，将被系统收回并永久注销！
         */

        Integer id;
        Integer operation;
        String title;
        String img;
        String link;
        String content;
        String display_type;//0= 只展示一次，1= 一直展示

        public NoticeItem() {
        }

        public boolean isShowOnce() {
            return "0".equals(display_type);
        }

        public Integer getId() {
            return this.id;
        }

        public Integer getOperation() {
            return this.operation;
        }

        public String getTitle() {
            return this.title;
        }

        public String getImg() {
            return this.img;
        }

        public String getLink() {
            return this.link;
        }

        public String getContent() {
            return this.content;
        }

        public String getDisplay_type() {
            return this.display_type;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public void setOperation(Integer operation) {
            this.operation = operation;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public void setImg(String img) {
            this.img = img;
        }

        public void setLink(String link) {
            this.link = link;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public void setDisplay_type(String display_type) {
            this.display_type = display_type;
        }

        public boolean equals(final Object o) {
            if (o == this) return true;
            if (!(o instanceof NoticeItem)) return false;
            final NoticeItem other = (NoticeItem) o;
            if (!other.canEqual((Object) this)) return false;
            final Object this$id = this.getId();
            final Object other$id = other.getId();
            if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
            final Object this$operation = this.getOperation();
            final Object other$operation = other.getOperation();
            if (this$operation == null ? other$operation != null : !this$operation.equals(other$operation))
                return false;
            final Object this$title = this.getTitle();
            final Object other$title = other.getTitle();
            if (this$title == null ? other$title != null : !this$title.equals(other$title))
                return false;
            final Object this$img = this.getImg();
            final Object other$img = other.getImg();
            if (this$img == null ? other$img != null : !this$img.equals(other$img)) return false;
            final Object this$link = this.getLink();
            final Object other$link = other.getLink();
            if (this$link == null ? other$link != null : !this$link.equals(other$link))
                return false;
            final Object this$content = this.getContent();
            final Object other$content = other.getContent();
            if (this$content == null ? other$content != null : !this$content.equals(other$content))
                return false;
            final Object this$display_type = this.getDisplay_type();
            final Object other$display_type = other.getDisplay_type();
            if (this$display_type == null ? other$display_type != null : !this$display_type.equals(other$display_type))
                return false;
            return true;
        }

        protected boolean canEqual(final Object other) {
            return other instanceof NoticeItem;
        }

        public int hashCode() {
            final int PRIME = 59;
            int result = 1;
            final Object $id = this.getId();
            result = result * PRIME + ($id == null ? 43 : $id.hashCode());
            final Object $operation = this.getOperation();
            result = result * PRIME + ($operation == null ? 43 : $operation.hashCode());
            final Object $title = this.getTitle();
            result = result * PRIME + ($title == null ? 43 : $title.hashCode());
            final Object $img = this.getImg();
            result = result * PRIME + ($img == null ? 43 : $img.hashCode());
            final Object $link = this.getLink();
            result = result * PRIME + ($link == null ? 43 : $link.hashCode());
            final Object $content = this.getContent();
            result = result * PRIME + ($content == null ? 43 : $content.hashCode());
            final Object $display_type = this.getDisplay_type();
            result = result * PRIME + ($display_type == null ? 43 : $display_type.hashCode());
            return result;
        }

        public String toString() {
            return "ClientConfig.NoticeItem(id=" + this.getId() + ", operation=" + this.getOperation() + ", title=" + this.getTitle() + ", img=" + this.getImg() + ", link=" + this.getLink() + ", content=" + this.getContent() + ", display_type=" + this.getDisplay_type() + ")";
        }
    }

    public static class WebUrl {
        String title = "";
        public int version = 0;
        public String url = Constants.Api_Product;
        public String img_url = Constants.Api_Product;

        public WebUrl() {
        }

        public String getTitle() {
            return this.title;
        }

        public int getVersion() {
            return this.version;
        }

        public String getUrl() {
            return this.url;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public void setVersion(int version) {
            this.version = version;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public boolean equals(final Object o) {
            if (o == this) return true;
            if (!(o instanceof WebUrl)) return false;
            final WebUrl other = (WebUrl) o;
            if (!other.canEqual((Object) this)) return false;
            final Object this$title = this.getTitle();
            final Object other$title = other.getTitle();
            if (this$title == null ? other$title != null : !this$title.equals(other$title))
                return false;
            if (this.getVersion() != other.getVersion()) return false;
            final Object this$url = this.getUrl();
            final Object other$url = other.getUrl();
            if (this$url == null ? other$url != null : !this$url.equals(other$url)) return false;
            return true;
        }

        protected boolean canEqual(final Object other) {
            return other instanceof WebUrl;
        }

        public int hashCode() {
            final int PRIME = 59;
            int result = 1;
            final Object $title = this.getTitle();
            result = result * PRIME + ($title == null ? 43 : $title.hashCode());
            result = result * PRIME + this.getVersion();
            final Object $url = this.getUrl();
            result = result * PRIME + ($url == null ? 43 : $url.hashCode());
            return result;
        }

        public String toString() {
            return "ClientConfig.WebUrl(title=" + this.getTitle() + ", version=" + this.getVersion() + ", url=" + this.getUrl() + ")";
        }
    }

    public static class Type_info {
        String type;
        String title;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }
    }
}
